<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: src/include/lwip/dns.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('dns_8h.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dns.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="opt_8h.html">lwip/opt.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="ip__addr_8h.html">lwip/ip_addr.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="err_8h.html">lwip/err.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a464a7435c4c00735af59033d2acd83bb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8h.html#a464a7435c4c00735af59033d2acd83bb">DNS_TMR_INTERVAL</a>&#160;&#160;&#160;1000</td></tr>
<tr class="separator:a464a7435c4c00735af59033d2acd83bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ab5a9dec5b22802f91876c53e99f427ae"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8h.html#ab5a9dec5b22802f91876c53e99f427ae">dns_found_callback</a>) (const char *name, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *ipaddr, void *callback_arg)</td></tr>
<tr class="separator:ab5a9dec5b22802f91876c53e99f427ae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:adb31c3b6180773bd11f914c327f209cf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8h.html#adb31c3b6180773bd11f914c327f209cf">dns_init</a> (void)</td></tr>
<tr class="separator:adb31c3b6180773bd11f914c327f209cf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9389f374ec66488aa4f42a652583f533"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dns_8h.html#a9389f374ec66488aa4f42a652583f533">dns_tmr</a> (void)</td></tr>
<tr class="separator:a9389f374ec66488aa4f42a652583f533"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf66c5d8273f83cdc2cdd8911fb68d584"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gaf66c5d8273f83cdc2cdd8911fb68d584">dns_setserver</a> (u8_t numdns, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *dnsserver)</td></tr>
<tr class="separator:gaf66c5d8273f83cdc2cdd8911fb68d584"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad02111a6b26b93f1c3580d5f41a59af3"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gad02111a6b26b93f1c3580d5f41a59af3">dns_getserver</a> (u8_t numdns)</td></tr>
<tr class="separator:gad02111a6b26b93f1c3580d5f41a59af3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e040ec38166dc9bfcc3473aab0c799f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#ga1e040ec38166dc9bfcc3473aab0c799f">dns_gethostbyname</a> (const char *hostname, <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *addr, <a class="el" href="dns_8h.html#ab5a9dec5b22802f91876c53e99f427ae">dns_found_callback</a> found, void *callback_arg)</td></tr>
<tr class="separator:ga1e040ec38166dc9bfcc3473aab0c799f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae84449f60dca6b863142daca8e03ce79"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__dns.html#gae84449f60dca6b863142daca8e03ce79">dns_gethostbyname_addrtype</a> (const char *hostname, <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *addr, <a class="el" href="dns_8h.html#ab5a9dec5b22802f91876c53e99f427ae">dns_found_callback</a> found, void *callback_arg, u8_t dns_addrtype)</td></tr>
<tr class="separator:gae84449f60dca6b863142daca8e03ce79"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>DNS API </p>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a464a7435c4c00735af59033d2acd83bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a464a7435c4c00735af59033d2acd83bb">&#9670;&nbsp;</a></span>DNS_TMR_INTERVAL</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DNS_TMR_INTERVAL&#160;&#160;&#160;1000</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>lwip DNS resolver header file.</p>
<p>Author: Jim Pettinato April 2007</p>
<p>ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p><ol type="1">
<li>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</li>
<li>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.</li>
<li>The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.</li>
</ol>
<p>THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.DNS timer period </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ab5a9dec5b22802f91876c53e99f427ae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab5a9dec5b22802f91876c53e99f427ae">&#9670;&nbsp;</a></span>dns_found_callback</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* dns_found_callback) (const char *name, const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *ipaddr, void *callback_arg)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Callback which is invoked when a hostname is found. A function of this type must be implemented by the application using the DNS resolver. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>pointer to the name that was looked up. </td></tr>
    <tr><td class="paramname">ipaddr</td><td>pointer to an ip_addr_t containing the IP address of the hostname, or NULL if the name could not be found (or on any other error). </td></tr>
    <tr><td class="paramname">callback_arg</td><td>a user-specified callback argument passed to dns_gethostbyname </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="adb31c3b6180773bd11f914c327f209cf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adb31c3b6180773bd11f914c327f209cf">&#9670;&nbsp;</a></span>dns_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dns_init </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Initialize the resolver: set up the UDP pcb and configure the default server (if DNS_SERVER_ADDRESS is set). </p>

</div>
</div>
<a id="a9389f374ec66488aa4f42a652583f533"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9389f374ec66488aa4f42a652583f533">&#9670;&nbsp;</a></span>dns_tmr()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void dns_tmr </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The DNS resolver client timer - handle retries and timeouts and should be called every DNS_TMR_INTERVAL milliseconds (every second by default). </p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_b0856f6b0d80ccb263b2f415c91f9e17.html">include</a></li><li class="navelem"><a class="el" href="dir_4e6b3cf33a61b6caac9c8ac30c866f37.html">lwip</a></li><li class="navelem"><a class="el" href="dns_8h.html">dns.h</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
